﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IronCow.UnitTests.Mock
{
    class MockSuccessResponse : MockResponse
    {
        private string mApiKey;

        public MockSuccessResponse()
            : this(MockRestClient.DefaultApiKey)
        {
        }

        public MockSuccessResponse(string apiKey)
        {
            mApiKey = apiKey;
        }

        public override void GetResponseMarkup(System.Xml.XmlWriter markupWriter, Dictionary<string, string> parameters)
        {
            markupWriter.WriteStartDocument();
            markupWriter.WriteStartElement("rsp");
            markupWriter.WriteAttributeString("stat", "ok");
            {
                markupWriter.WriteElementString("api_key", mApiKey);
                GetNestedResponseMarkup(markupWriter, parameters);
            }
            markupWriter.WriteEndElement();
            markupWriter.WriteEndDocument();
        }
    }
}
